CoreList
| Kind of class: | class |
|---|---|
| Inherits from: | UIComponent < MovieClip |
| Known subclasses: | |
| Classpath: | gfx.controls.CoreList |
| File last modified: | Tuesday, 29 June 2010, 09:03:27 |
An abstract class used to display a list of data, and set a selectedIndex (or indices). This class only manages data, and instantiating itemRenderers, but the sub-class must request the renderers and arrange them. It is sub-classed by the ScrollingList and TileList components.
Component metadata:
| InspectableList | "disabled" "enableInitCallback" "inspectableRendererInstanceName" "itemRenderer" "soundMap" "visible" |
|---|
Summary
Constructor
Instance properties
- soundMap
- Mapping between events and sound process
- itemRenderer
- The linkage ID for the renderer used to display each item in the list.
- dataProvider
- The data model displayed in the component.
- selectedIndex
- The index of the item that is selected in a single-selection list.
- labelField
- The name of the field in the dataProvider model to be displayed as the label for itemRenderers.
- labelFunction
- The function used to determine the label for itemRenderers.
- availableWidth
- The amount of the component's width that can be used for renderers.
- availableHeight
- The amount of the component's height that can be used for renderers.
- rendererInstanceName
- The name of data renderers to be used in this list instance.
Instance properties inherited from UIComponent
__height __width _disabled _displayFocus _focused addEventListener cleanUpEvents disabled dispatchEvent displayFocus enableInitCallback focused focusHandlerReference focusTarget hasEventListener height initialized invalidationIntervalID removeAllEventListeners removeEventListener sizeIsInvalid soundMap visible width
Class methods
Class methods inherited from UIComponent
Instance methods
- scrollToIndex
- Scrolls the list to the item at the specified index.
- itemToLabel
- Convert an item to a label string using the labelField and labelFunction.
- invalidateData
- The current data has become invalid, either by a data change, or a display change such as scrolling.
- setRendererList
- Set a list of external MovieClips to use as renderers, instead of auto-generating the renderers at run-time.
Instance methods inherited from UIComponent
Constructor
CoreList
function CoreList (
)
The constructor is called when a CoreList or a sub-class of CoreList is instantiated on stage or by using
attachMovie() in ActionScript. This component can not be instantiated using new syntax. When creating new components that extend CoreList, ensure that a super() call is made first in the constructor. Instance properties
availableHeight
availableHeight:Number
(read)
The amount of the component's height that can be used for renderers. This can be overridden to accommodate padding or ScrollBars
availableWidth
availableWidth:Number
(read)
The amount of the component's width that can be used for renderers. This can be overridden to accommodate padding or ScrollBars.
dataProvider
dataProvider:Object
(read,write)
The data model displayed in the component. The dataProvider can be an Array or any object exposing the appropriate API, defined in the
IDataProvider interface. If an Array is set as the dataProvider, functionality will be mixed into it by the DataProvider.initialize method. When a new DataProvider is set, the selectedIndex property will be reset to 0. itemRenderer
itemRenderer:String
(read,write)
The linkage ID for the renderer used to display each item in the list. The list components only support a single itemRenderer for all items.
labelField
labelField:String
(read,write)
The name of the field in the
dataProvider model to be displayed as the label for itemRenderers. A labelFunction will be used over a labelField if it is defined. See also:
labelFunction
labelFunction:Function
(read,write)
The function used to determine the label for itemRenderers. A
labelFunction will override a labelField if it is defined. See also:
rendererInstanceName
rendererInstanceName:String
(read,write)
The name of data renderers to be used in this list instance. The names are a string followed by consecutive numbers incrementing from 0 or 1. For instance "renderer1, renderer2, renderer3, etc". The renderers must be in the parent timeline of the list instance in order to be used. If a specific numbered clip is missing, then only the renderers up to that point will be used.
selectedIndex
selectedIndex:Number
(read,write)
The index of the item that is selected in a single-selection list.
soundMap
soundMap:Object = { theme:"default", focusIn:"focusIn", focusOut:"focusOut", select:"select", change:"change", rollOver:"rollOver", rollOut:"rollOut", itemClick:"itemClick", itemDoubleClick:"itemDoubleClick", itemPress:"itemPress", itemRollOver:"itemRollOver", itemRollOut:"itemRollOut" }
(read,write)
Mapping between events and sound process
Instance methods
invalidateData
function invalidateData (
) : Void
The current data has become invalid, either by a data change, or a display change such as scrolling. It is up to the sub-classes to determine the behaviour.
itemToLabel
function itemToLabel (
item:Object) : String
Convert an item to a label string using the
labelField and labelFunction. Parameters:
item:
The item to convert to a label.
Returns:
- The converted label string.
See also:
scrollToIndex
function scrollToIndex (
index:Number) : Void
Scrolls the list to the item at the specified index. If the index is not out of range, the scroll position does not change. This method is not implemented in CoreList, so it must be implemented in sub-classes.
Parameters:
index:
The index in the
dataProvider to scroll to.setRendererList
function setRendererList (
value:Array) : Void
Set a list of external MovieClips to use as renderers, instead of auto-generating the renderers at run-time. The rendererInstance property uses this method to set the renderer list.